package com.smartfactory.sail.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.smartfactory.sail.dto.OrderNumDto;
import com.smartfactory.sail.dto.PersonRankingDto;
import com.smartfactory.sail.entity.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.smartfactory.sail.vo.order.ListHTOrderListResp;
import com.smartfactory.sail.vo.order.ListYPOrderListResp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 订单表 Mapper 接口
 * </p>
 *
 * @author 王巨壁
 * @since 2019-07-24
 */
@Mapper
public interface OrderMapper extends BaseMapper<Order> {
    //获取合同订单
    IPage<ListHTOrderListResp> getHTorderListPage(IPage<ListHTOrderListResp> page, @Param("ew") Wrapper<ListHTOrderListResp> queryWrapper);
    IPage<ListYPOrderListResp> getYPorderListPage(IPage<ListYPOrderListResp> page, @Param("ew") Wrapper<ListYPOrderListResp> queryWrapper);

    //获取订单各状态数量
    List<OrderNumDto> getOrderNum();

    //获取个人业务排行列表
    List<PersonRankingDto> getPersonRanking();

    List<Long> getOrderItemsByOrderIdAndMaterialId(@Param("orderId")Long orderId,@Param("materialId")Long materialId);
}
